Allow settings auto favorite from automotive#6718
Draft
cddu33 wants to merge 66 commits intohome-assistant:mainfrom
Draft
Allow settings auto favorite from automotive#6718cddu33 wants to merge 66 commits intohome-assistant:mainfrom
cddu33 wants to merge 66 commits intohome-assistant:mainfrom
Conversation
Author
|
Hi everyone, ,it's my firt PR for HA, .It's only for Android automotive :) |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an in-car “Manage favorites” flow for Android Automotive (full flavor) so users can edit the Driving favorites list when the vehicle is not in distraction-optimized mode.
Changes:
- Add a new Automotive screen to toggle favorites across supported entities, including simple paging
- Add a “Manage favorites” header action on Automotive screens for the
fullflavor when parked - Refactor Automotive UX restriction handling in
BaseVehicleScreen
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| common/src/main/res/values/strings.xml | Adds strings for the new “Manage favorites” UI and paging labels |
| app/src/main/kotlin/io/homeassistant/companion/android/vehicle/ManageFavoritesVehicleScreen.kt | New Automotive screen to add/remove favorites via toggles |
| app/src/main/kotlin/io/homeassistant/companion/android/vehicle/MainVehicleScreen.kt | Adds header action to open favorites management when parked (full flavor) |
| app/src/main/kotlin/io/homeassistant/companion/android/vehicle/DomainListScreen.kt | Adds the same header action on the domain list screen |
| app/src/main/kotlin/io/homeassistant/companion/android/vehicle/BaseVehicleScreen.kt | Updates how UX restriction state is sourced and logs restriction changes |
| app/src/main/kotlin/io/homeassistant/companion/android/util/vehicle/TemplateComponents.kt | Adds helper to create the “Manage favorites” header action |
| .idea/markdown.xml | Adds IDE configuration file (should not be committed) |
Files not reviewed (1)
- .idea/markdown.xml: Language not supported
…/ManageFavoritesVehicleScreen.kt Logging raw entityId can leak user-specific information (entity IDs often include user-defined names). Prefer removing these logs or wrapping the value with sensitive(...) as used elsewhere in the app. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
aa_manage_favorites_parked_only is added but not referenced anywhere in the PR. If it’s not needed, remove it to avoid unused resource warnings; if it is needed, wire it into the UI where the parked-only restriction is enforced. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…/DomainListScreen.kt Kotlin style in this codebase generally uses trailing commas for multiline argument lists; add a trailing comma after prefsRepository to match surrounding calls and avoid ktlint churn. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…/MainVehicleScreen.kt Kotlin style in this codebase generally uses trailing commas for multiline argument lists; add a trailing comma after prefsRepository to match surrounding calls and avoid ktlint churn. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…/ManageFavoritesVehicleScreen.kt
Sorting computes favorite membership with favoritesList.any { ... } for every entity, which is O(entities × favorites). Consider building a Set (or HashSet) of favorite entityIds for the current server once per update and using contains in both the sort and row-building logic.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…/ManageFavoritesVehicleScreen.kt itemsPerPage always reserves space for both paging rows by doing listLimit - 2, even when only one (or neither) paging row is shown. This reduces the number of entities shown per page unnecessarily and can make paging feel off. Consider calculating the reserved rows based on hasPreviousPage/hasNextPage for the current page. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…cddu33/android into feature/add-favorite-automotive
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…cddu33/android into feature/add-favorite-automotive
This reverts commit 03b9cc0. Co-authored-by: Claude <noreply@anthropic.com>
Author
|
Hi @TimoPtr i updated my PR , thanks for your feedback |
There was a problem hiding this comment.
ktlint found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
TimoPtr
reviewed
May 7, 2026
TimoPtr
reviewed
May 7, 2026
…/ManageFavoritesVehicleScreen.kt Co-authored-by: Timothy <6560631+TimoPtr@users.noreply.github.com>
…/ManageFavoritesVehicleScreen.kt Co-authored-by: Timothy <6560631+TimoPtr@users.noreply.github.com>
TimoPtr
reviewed
May 7, 2026
TimoPtr
reviewed
May 7, 2026
TimoPtr
reviewed
May 7, 2026
TimoPtr
reviewed
May 7, 2026
Member
|
From claude I think you need to spend sometime writing some tests on your pagination logic. |
…/ManageFavoritesVehicleScreen.kt Co-authored-by: Timothy <6560631+TimoPtr@users.noreply.github.com>
- Wrap state into UIState data class protected by stateMutex - Move prev/next pagination to header (addEndHeaderAction) to free list slots - Add SearchFavoritesVehicleScreen (private) with SearchTemplate for inline filtering - Fix computePageSlice: page clamped, no slot wasted since nav is in header - Extract shared helpers: persistFavoriteToggle, compareByFavoriteThenName, etc. - Resolve merge conflict with origin/feature/add-favorite-automotive - Add strings: aa_search_entities, aa_search_no_results Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
I have a Renault Scenic with Android Automotive, but Debug Mode is secured. Therefore, I can't install the minimal version of Home Assistant.
I created a 'favorites' mode for the full release. Users can add favorites on the home screen only when the car is parked (not while driving).
Checklist
Screenshots